home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Cia.mod < prev    next >
Text File  |  1994-08-08  |  2KB  |  119 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Cia.mod $
  4.   Description: Interface to ciaa.resource and ciab.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:50:01 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Cia;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT E := Exec;
  31.  
  32.  
  33. (*
  34. **      $VER: cia.h 36.4 (9.1.91)
  35. **
  36. **      Cia resource name strings.
  37. *)
  38.  
  39. CONST
  40.  
  41.   ciaaName * = "ciaa.resource";
  42.   ciabName * = "ciab.resource";
  43.  
  44. (*
  45. **      $VER: ciabase.h 1.2 (16.5.90)
  46. **
  47. **      cia base definitions
  48. *)
  49.  
  50.  
  51. (*
  52.  *      There is no public information in CiaBase
  53.  *)
  54.  
  55.  
  56. (**-- Resource Base variable --------------------------------------------*)
  57.  
  58. TYPE
  59.  
  60.   CiaBasePtr * = CPOINTER TO CiaBase;
  61.   CiaBase * = RECORD END;
  62.  
  63. VAR
  64.  
  65.   ciaA *, ciaB * : CiaBasePtr;
  66.  
  67.  
  68. (**-- Resource Functions ------------------------------------------------*)
  69.  
  70. (*
  71. **      $VER: cia_protos.h 1.7 (19.7.90)
  72. *)
  73.  
  74.  
  75. LIBCALL (base : CiaBasePtr) AddICRVector*
  76.   ( icrBit    [0] : SHORTINT;
  77.     interrupt [9] : E.InterruptPtr )
  78.   : E.InterruptPtr;
  79.   -6;
  80. LIBCALL (base : CiaBasePtr) RemICRVector*
  81.   ( icrBit    [0] : LONGINT;
  82.     interrupt [9] : E.InterruptPtr );
  83.   -12;
  84. LIBCALL (base : CiaBasePtr) AbleICR*
  85.   ( mask [0] : E.BSET )
  86.   : E.BSET;
  87.   -18;
  88. LIBCALL (base : CiaBasePtr) SetICR*
  89.   ( mask [0] : E.BSET )
  90.   : E.BSET;
  91.   -24;
  92.  
  93.  
  94. (**-- Resource Base variable --------------------------------------------*)
  95. (** $L- Address globals through A4 *)
  96.  
  97.  
  98. (**-----------------------------------*)
  99. PROCEDURE OpenCiaA * (mustOpen : BOOLEAN);
  100.  
  101. BEGIN (* OpenCiaA *)
  102.   IF ciaA = NIL THEN
  103.     ciaA := E.base.OpenResource (ciaaName);
  104.     IF mustOpen & (ciaA = NIL) THEN HALT (100) END;
  105.   END; (* IF *)
  106. END OpenCiaA;
  107.  
  108. (**-----------------------------------*)
  109. PROCEDURE OpenCiaB * (mustOpen : BOOLEAN);
  110.  
  111. BEGIN (* OpenCiaB *)
  112.   IF ciaB = NIL THEN
  113.     ciaB := E.base.OpenResource (ciabName);
  114.     IF mustOpen & (ciaB = NIL) THEN HALT (100) END;
  115.   END; (* IF *)
  116. END OpenCiaB;
  117.  
  118. END Cia.
  119.